package com.ewzj.bigdata.mvp.ui.adapter

import android.view.View
import android.widget.ImageView

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.ewzj.bigdata.R
import com.ewzj.bigdata.app.extensions.loadImgwithloading
import com.ewzj.bigdata.mvp.model.rspbean.RspOriginBean

/**
 * author:zhangjing
 * 作用:
 * return:
 */

class OriginInnerAdapter(data: List<RspOriginBean.TopicEntity>) : BaseQuickAdapter<RspOriginBean.TopicEntity, BaseViewHolder>(R.layout.item_origin_inntertype, data) {

    override fun convert(baseViewHolder: BaseViewHolder, topicEntity: RspOriginBean.TopicEntity) {
        //        AppUtils.loadImgwithloading(mContext,topicEntity.getThumb(), (ImageView) baseViewHolder.getView(R.id.iv_pic));
        (baseViewHolder!!.getView<ImageView>(R.id.iv_pic)).loadImgwithloading(topicEntity.getThumb())
        baseViewHolder.setText(R.id.tv_title, topicEntity.title)
        baseViewHolder.setText(R.id.tv_source, topicEntity.sources)
        baseViewHolder.setText(R.id.tv_time, topicEntity.create_time)
        baseViewHolder.setText(R.id.tv_watch, topicEntity.visit)
        baseViewHolder.setText(R.id.tv_message, topicEntity.comment)
    }
}
